package com.mive.service.impl;

import com.mive.dao.AuthorDao;
import com.mive.entity.Author;
import com.mive.mapper.AuthorMapper;
import com.mive.service.AuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service(value = "authorService")
public class AuthorServiceImpl implements AuthorService {

    @Autowired
    private AuthorDao authorDao;
    @Resource
    private AuthorMapper authorMapper;

    @Override
    public void create(Author author) {

        this.authorDao.create(author);
    }

    @Override
    public void modify(Author author) {

        this.authorDao.modify(author);
    }

    @Override
    public void romove(Long uid) {

        this.authorDao.romove(uid);
    }

    @Override
    public Author getAutho(Long uid) {

        return this.authorDao.getAutho(uid);
    }

    @Override
    public List<Author> getAuthorList() {
        return this.authorDao.getAuthorList();
    }

    @Override
    public void insert(Author author) {
        authorMapper.insert(author);
    }

    @Override
    public void delete(Long uid) {
        authorMapper.delete(uid);
    }

    @Override
    public void update(Author author) {
        authorMapper.update(author);
    }

    @Override
    public Author getAuthor(Long uid) {
        return authorMapper.getAuthor(uid);
    }

    @Override
    public List<Author> getAll() {
        return authorMapper.getAll();
    }
}
